using System;

namespace WIT.DAQ.Core.Models;

/// <summary>
/// 数据采集项
/// </summary>
[Serializable]
public class DAQItem
{
	/// <summary>
	/// Id
	/// </summary>
	public Guid Id { get; set; }

	/// <summary>
	/// 名称
	/// </summary>
	public string Name { get; set; }

	/// <summary>
	/// 采集项标识符
	/// </summary>
	public string Identifier { get; set; }

	/// <summary>
	/// 站点Id
	/// </summary>
	public Guid StationId { get; set; }

	/// <summary>
	/// 设备Id
	/// </summary>
	public Guid DeviceId { get; set; }

	/// <summary>
	/// 数据类型
	/// </summary>
	public string DataType { get; set; }

	/// <summary>
	/// 描述
	/// </summary>
	public string Desc { get; set; }

	/// <summary>
	/// 用于控件显示的文本
	/// </summary>
	public string ShowName => Name + " [" + DataType + "]";

	/// <summary>
	/// 使用OPC-UA协议时需要配置NodeId
	/// </summary>
	public string NodeId { get; set; }

	/// <summary>
	/// 使用其它协议时需要配置地址
	/// </summary>
	public string Address { get; set; }

	/// <summary>
	/// Modbus读取String时需要指定长度
	/// </summary>
	public int? Length { get; set; }
}
